package 预习的;

public class 返回值Avg {

    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};

        double avg2 = getAvg(arr);

        System.out.println(avg2);
    }

    public static double getAvg(int[] arr) {
        int sum = 0;


        for (int i = 0; i < arr.length; i++) {

            sum += arr[i];

        }

        double avg = sum / arr.length;

        return avg;
    }

}
